package com.example.qxfw.nyqx.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.qxfw.common.entity.yj.ZhqhYzDisppara;
import com.example.qxfw.nyqx.mapper.ZhqhYzDispparaMapper;
import com.example.qxfw.nyqx.service.ZhqhYzDispparaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ZhqhYzDispparaServiceImpl implements ZhqhYzDispparaService {

    @Autowired
    private ZhqhYzDispparaMapper zhqhYzDispparaMapper;

    @Override
    public List<ZhqhYzDisppara> getList(String factorIndex) {
        return zhqhYzDispparaMapper.selectList(Wrappers.<ZhqhYzDisppara>lambdaQuery().eq(ZhqhYzDisppara::getFactorindex,factorIndex));
    }

    @Override
    public Integer save(ZhqhYzDisppara zhqhYzDisppara) {
        return zhqhYzDispparaMapper.insert(zhqhYzDisppara);
    }

    @Override
    public Integer delete(String id) {
        return zhqhYzDispparaMapper.delete(Wrappers.<ZhqhYzDisppara>lambdaQuery().eq(ZhqhYzDisppara::getId,id));
    }

    @Override
    public Integer update(ZhqhYzDisppara zhqhYzDisppara) {
        return zhqhYzDispparaMapper.update(zhqhYzDisppara,Wrappers.<ZhqhYzDisppara>lambdaUpdate().eq(ZhqhYzDisppara::getId,zhqhYzDisppara.getId()));
    }
}
